/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/*******************************************************************************
    FILE NAME:		ecan_limits.h

    PROJECT:		Linux ECAN527/1000 driver, library, and sample programs

    FILE DESCRIPTION:	This header file contains definitions for some
    			numerical limits.

    Copyright (c) 2004 RTD Embedded Technologies, Inc.

    For driver version, compiler, and target information, please refer to the
    file README.TXT.
*******************************************************************************/

#ifndef  _ECAN_LIMITS_H
# define _ECAN_LIMITS_H

# include <arch.h>


# ifndef __KERNEL__
#
#  include <limits.h>
#
#  ifdef     linux
#   include <linux/limits.h>
#  endif
#
#  ifndef  OPEN_MAX
#   define OPEN_MAX 256
#  endif
#
# endif


# ifndef      CHAR_BITS
#  define     CHAR_BITS	( sizeof(char     ) * BYTE_BITS )
# endif

# ifndef     SHORT_BITS
#  define    SHORT_BITS	( sizeof(short    ) * BYTE_BITS )
# endif

# ifndef       INT_BITS
#  define      INT_BITS	( sizeof(int      ) * BYTE_BITS )
# endif

# ifndef      LONG_BITS
#  define     LONG_BITS	( sizeof(long     ) * BYTE_BITS )
# endif

# ifndef  LONGLONG_BITS
#  define LONGLONG_BITS	( sizeof(long long) * BYTE_BITS )
# endif

/* ISO C99 style (LLONG) name */
# ifndef     LLONG_BITS
#  define    LLONG_BITS	LONGLONG_BITS
# endif


/* SUSv2 names */

# ifndef  CHAR_BIT
#  define CHAR_BIT BYTE_BITS	/* brain-damaged C */
# endif

/* Number of bits in a word OR type int (SUSv2) */
/* "word" is the contents of a machine register */
# ifndef  WORD_BIT
#  define WORD_BIT WORD_BITS
# endif

# ifndef  LONG_BIT
#  define LONG_BIT LONG_BITS
# endif




# ifndef  UCHAR_MAX
#  define UCHAR_MAX		((unsigned char)UINT_MAX)
# endif

# ifndef  SCHAR_MAX
#  define SCHAR_MAX		((signed char)INT_MAX)
# endif

# ifndef  SCHAR_MIN
#  define SCHAR_MIN		(-SCHAR_MAX - (signed char)1)
# endif


# ifndef  USHORT_MAX
#  define USHORT_MAX		((unsigned short)~0)
# endif

# ifndef  SHORT_MAX
#  define SHORT_MAX		((short)INT_MAX)
# endif

# ifndef  SHORT_MIN
#  define SHORT_MIN		(-SHORT_MAX - (short)1)
# endif


# ifndef  UINT_MAX
#  define UINT_MAX		(~0U)
# endif

# ifndef  INT_MAX
#  define INT_MAX		((int)(~0U>>1))
# endif

# ifndef  INT_MIN
#  define INT_MIN		(-INT_MAX - 1)
# endif


# ifndef  ULONG_MAX
#  define ULONG_MAX		(~0UL)
# endif

# ifndef   LONG_MAX
#  define  LONG_MAX		((long)(~0UL>>1))
# endif

# ifndef   LONG_MIN
#  define  LONG_MIN		(-LONG_MAX - 1L)
# endif


# ifndef  ULONGLONG_MAX
#  define ULONGLONG_MAX		(~0ULL)
# endif

# ifndef   LONGLONG_MAX
#  define  LONGLONG_MAX		((longlong)(~0ULL>>1))
# endif

# ifndef   LONGLONG_MIN
#  define  LONGLONG_MIN		(-LONGLONG_MAX - 1LL)
# endif


/* + ISO C99 */
# ifndef  ULLONG_MAX
#  define ULLONG_MAX		ULONGLONG_MAX
# endif

# ifndef  LLONG_MAX
#  define LLONG_MAX		 LONGLONG_MAX
# endif

# ifndef  LLONG_MIN
#  define LLONG_MIN		 LONGLONG_MIN
# endif
/* - ISO C99 */


# ifndef  SIZE_MAX
#  define SIZE_MAX		((size_t)ULONG_MAX)
# endif

# ifndef  SSIZE_MAX
#  define SSIZE_MAX		((ssize_t)LONG_MAX)
# endif

# ifndef  SSIZE_MIN
#  define SSIZE_MIN		(-SSIZE_MAX - (ssize_t)1)
# endif


#endif	/* _ECAN_LIMITS_H */
